package br.ufc.ck0017.frame;

import br.ufc.ck0017.ir.tree.IRNode;
import br.ufc.ck0017.temp.Label;
import br.ufc.ck0017.temp.Temp;

import java.util.ArrayList;
import java.util.List;

public abstract class Frame {
    protected final Label label;
    protected final List<Access> formals;

    protected Frame(Label label, List<Access> formals) {
        this.label = label;
        this.formals = new ArrayList<>(formals);
    }

    public abstract Integer getWordSize();
    public abstract Access allocateLocal(Boolean escape);
    public abstract Frame newFrame(Label name, List<Boolean> escapes);

    public abstract Temp getFramePointer();
    public abstract Temp getReturnValuePointer();

    public abstract IRNode onMethodExit(IRNode body);
}
